package com.aistar.mapper;

import com.aistar.model.entity.Tag;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName: TagMapper
 * @author: LiuWenXiu
 * @date: 2021/9/26 18:44
 * @Description: TODO...
 */
public interface TagMapper {

    @Select("select * from tag")
    List<Tag> findAll();

    //通过id查找标签
    @Select("select details from tag where id=#{id}")
    String findById(Integer id);

    // 根据标签类别id加载标签
    @Select("select * from tag where type_id = #{typeId}")
    List<Tag> findByType(Integer typeId);

    // 根据id获取全部信息
    @Select("select * from tag where id = #{id}")
    Tag getById(Integer id);

}
